package com.aaa.phone.dao.positiondao;

import com.aaa.entity.BatteryPosition;
import com.aaa.entity.Position;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * Demo class
 *
 * @author kevin
 * @date 2018/12/17 20:32:33
 */
@Mapper
@Component
public interface PositionDao {

    /**
     * @Description: 返回电池坐标数组
     * @Param:
     * @return: List<BatteryPosition>
     * @Author: Kevin Jia
     * @Date: 2018/12/18
     * @Time: 19:03:33
     */
    List<BatteryPosition> getAllPosition(Position position);

    /**
     * @Description: 获取服务电话
     * @Param: String
     * @return:
     * @Author: Kevin Jia
     * @Date: 2018/12/20
     * @Time: 19:29
     */
    String getServicePhone(String phone);

    /**
     * @Description: 查询是否有可用电池
     * @Param: addName
     * @return: Integer
     * @Author: Kevin Jia
     * @Date: 2018/12/26
     * @Time: 9:26
     */
    Integer getBatteryQuantitys(String pid);

    /**
     * @Description: pid的充电点可用电瓶数量-1
     * @Param: pid
     * @return: void
     * @Author: Kevin Jia
     * @Date: 2018/12/26
     * @Time: 9:36
     */
    void changeBatteryCount(@Param("pid") String pid);

    /**
     * @Description: 插入充电表
     * @Param: pid
     * @return: void
     * @Author: Kevin Jia
     * @Date: 2018/12/26
     * @Time: 9:36
     */
    void insertBattery(String pid);

    /**
     * @Description: 查询电瓶可用数量
     * @Param: pid
     * @return: Integer
     * @Author: Kevin Jia
     * @Date: 2018/12/28
     * @Time: 18:56
     */
    Integer getBatteryQuantity(String pid);

    /**
     * @Description: 扣除用户账户里的余额的钱
     * @Param: telephone,money
     * @return: void
     * @Author: Kevin Jia
     * @Date: 2018/12/28
     * @Time: 20:17
     */
    void deductRMB(@Param("telephone") String telephone,@Param("money") String money);


    /**
     * @Description: 插入消费记录
     * @Param: employeeid,telephone,money
     * @return: void
     * @Author: Kevin Jia
     * @Date: 2018/12/28
     * @Time: 20:17
     */
    void insertExpenseOrder(@Param("orderNumber") String orderNumber,@Param("telephone") String telephone,@Param("money") String money);

    /**
     * @Description: 查询改用户是否购买车辆
     * @Param: phone1
     * @return: Integer
     * @Author: Kevin Jia
     * @Date: 2019/1/3
     * @Time: 19:33
     */
    Integer serchCar(String phone1);

    /**
     * @Description: 获取总部电话
     * @Param: none
     * @return: String
     * @Author: Kevin Jia
     * @Date: 2019/1/3
     * @Time: 19:43
     */
    String getServicePhoneG();
}
